package com.sac.emp.controller;

import com.sac.emp.domain.Employee;
import com.sac.emp.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 职员信息查询
 * @author xiaodong
 * @date 2018年9月13日 上午10:34:00
 * @desc
 */

@RestController
@RequestMapping("/employee")
public class EmployeeController {

	@Autowired
	private EmpService empService;

	@PostMapping("/empSearch/findByFullName")
	public Object findByFullName( String fullName) {

		List<Employee> list = empService.getAllEmp(fullName);

		return list ;
	}

	@PostMapping("/empSearch/findByEmpId")
	public Object findByEmpId( String empId) {

		Employee employee  = empService.getEmpDetailInfo(empId);

		return employee ;
	}
}
